//
//  MarqueeLabelController.m
//  TEXT
//
//  Created by mac on 2024/4/28.
//  Copyright © 2024 刘博. All rights reserved.
//

#import "MarqueeLabelController.h"
#import "LBMarqueeLayer.h"

@interface MarqueeLabelController ()

@property (nonatomic, strong) LBMarqueeLayer *textLayer;

@end

@implementation MarqueeLabelController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view.layer addSublayer:self.textLayer];
    // Do any additional setup after loading the view.
}

#pragma mark - lazy load

- (LBMarqueeLayer *)textLayer
{
    if (!_textLayer) {
        LBMarqueeLayerConfig *config = [[LBMarqueeLayerConfig alloc] init];
        config.hasPause = YES;
        config.hasPause = NO;
        config.pauseDuration = 3;
        config.blankString = @"      ";
        config.text = @"这是一首非常好听的歌曲哈哈哈哈";
        _textLayer = [[LBMarqueeLayer alloc] initwithFrame:CGRectMake(100, 100, 200, 50) config:config];
        _textLayer.backgroundColor = [UIColor cyanColor].CGColor;
    }
    return _textLayer;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
